﻿using Avalonia.Controls;
using iOSClub.WikiApp.Models;
using iOSClub.WikiApp.Views;
using WikiApp.Lib;

namespace iOSClub.WikiApp.TextPages;

public partial class TextPage : UserControl
{
    public TextPage()
    {
        InitializeComponent();
    }
    
    protected override async void OnInitialized()
    {
        var view = ViewOpera.GetView<MainWindow>(this);
        if(view == null)return;
        var a = await view._graphWiki.GetPageSingle((DataContext as PageItem)!.Id);
        Block.Text = a.Content;
    }
}